//一元二次方程ax2+bx+c=0的根，
//苏小红教材例5.4改写，严格按图5-7流程图设计的代码
#include <stdio.h>
#include <math.h>
#define EPS 1e-6

int main()
{
    float a,b,c;
    float disc,p,q;
    scanf("%f%f%f",&a,&b,&c);
    if(fabs(a)<EPS)
    {
        printf("It is not a quadratic equation!\n");
    }
    else
    {
        disc=b*b-4*a*c;
        p=-b/2/a;
        q=sqrt(fabs(disc))/2/a;
        if(fabs(disc)<EPS)
        {
            printf("x1 = x2 = %.2f\n",p);
        }
        else
        {
            if(disc>EPS)
            {
                 printf("x1 = %.2f\n",p+q);
                 printf("x2 = %.2f\n",p-q);
            }
            else
            {
                 printf("x1 = %.2f + %.2fi\n",p,q);
                 printf("x2 = %.2f - %.2fi\n",p,q);

            }
        }
    }
    return 0;
}
